package com.witmed.service.impl;

import java.util.List;

import com.witmed.dao.HospitalDao;
import com.witmed.dao.impl.HospitalDaoImpl;
/**
 * chenxiangyang 
 * 医院
 */
import com.witmed.entity.Hospital;
import com.witmed.service.HospitalService;

public class HospitalServiceImpl implements HospitalService {

	private HospitalDao hospitalDao = new HospitalDaoImpl();

	/**
	 * 插入医院信息
	 */
	@Override
	public boolean insertHospital(Hospital hospital) {
		// TODO Auto-generated method stub
		return hospitalDao.insert(hospital) > 0 ? true : false;
	}

	/**
	 * 根据医院名字查询id
	 */
	@Override
	public List<Hospital> findByHospitalName(String hospitalName) {
		// TODO Auto-generated method stub
		return hospitalDao.findHospitalId(hospitalName);
	}

	@Override
	public boolean deleteByHospitalId(int hospitalId) {
		// TODO Auto-generated method stub
		int i = hospitalDao.deleteByHospitalId(hospitalId);
		return i > 0 ? true : false;
	}

}
